package com.imooc.exception;

public enum BusinessExceptionCode {
    /**
     * E00001 ~ E01000 系统通用错误
     */
    NULL_OBJ("E00001", "对象为空"),
    UNKNOWN_ERROR("E00002", "系统繁忙,请稍后再试...."),
    /**
     * E01001 ~ E01200 用户相关
     */
    MEMBER_IS_EXIST("E01001", "用户已存在"),
    MEMBER_NOT_FOUND("E01002", "用户未找到"),
    MEMBER_PASSWORD_NOT_EQUALS("E01003", "密码输入有误"),
    /**
     * E01201 ~ E01300 评论相关
     */
    EVALUATION_NOT_FOUND("E01201", "评论未找到"),

    /**
     * E01301 ~ E01400 图书相关
     */
    BOOK_NOT_FOUND("E01301", "图书未找到"),
    /**
     * E01401 ~ E01500 管理员相关
     */
    USER_NOT_FOUND("E01401", "账号未找到"),
    USER_PASSWORD_ERROR("E01402", "密码错误"),

    /**
     * E01501 ~ E01600 短评相关
     */
    MANAGE_EVALUATION_NOT_FOUND("E01501", "短评未找到"),
    MANAGE_EVALUATION_REASON_NOT_EMPTY("E01502", "禁用理由不能为空"),
    ;
    private String code;
    private String message;

    BusinessExceptionCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "[" + getCode() +"]" + getMessage();
    }
}
